25. Custom Word Class Quiz

Custom Word Class

Question:

Create the Word Class

1. Create a new file called “Word.java” and add it under the “com.example.android.miwok” folder.

To create a new Class in Android Studio. Right click on the package in the project directory. Go to new Class.

Create a new Java Class

When the wizard pops up, give the class a name: Word. Accept the defaults and click Finish.

Word Activity

2. Define the Word class in the Word.java file with state and methods.

There should be no change in the appearance of your app yet, but be sure to run the app on your device to verify there are no errors in your code.

Start Quiz:

Solution: